#!/usr/bin/python
import util
import numpy

class Bs():

    def __init__(self, fftsize, cp):
        self.reg = []
        self.fft_size = fftsize
        self.cp_size = cp
    def tx(self, prmb_index, prmb_time_offset):
        iq_data = util.get_preamble(self.fft_size, prmb_index)
        frame = numpy.r_[[0]*(prmb_time_offset), iq_data[-1*self.cp_size:], iq_data, [0]*(self.fft_size - prmb_time_offset)]
        #print 'prmb idx is %d, time offset is %d'%(prmb_index, prmb_time_offset)
        return frame
